<?php
namespace App\Params\Backend;
use App\Params\Param;
/**
 * 店铺列表查询参数
 *
 * @author: WangBin
 * @date: 2022/01/19
 * @mail: <849850352@qq.com>
 */
class StoreListParam extends Param
{
    public $title;
    public $page_size = 20;
    public $page = 1;

    public function rules()
    {
        return [
            'title' => 'nullable|string',
            'page_size' => 'nullable|integer',
            'page' => 'nullable|integer',
        ];
    }

    /**
     * @return mixed
     */
    public function getTitle()
    {
        return $this->title;
    }

    /**
     * @param mixed $title
     */
    public function setTitle($title): void
    {
        $this->title = $title;
    }

    /**
     * @return int
     */
    public function getPageSize(): int
    {
        return $this->page_size;
    }

    /**
     * @param int $page_size
     */
    public function setPageSize(int $page_size): void
    {
        $this->page_size = $page_size;
    }

    /**
     * @return int
     */
    public function getPage(): int
    {
        return $this->page ? -- $this->page : 0;
    }

    /**
     * @param int $page
     */
    public function setPage(int $page): void
    {
        $this->page = $page;
    }
}
